home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_400 / 428_02 / examples / msgbox.c < prev    next >
C/C++ Source or Header  |  1994-03-13  |  528b  |  28 lines

  1. /*
  2. ** MSGBOX.C: Takes action based on the user's response to
  3. ** a message box.
  4. */
  5.  
  6. #include <pictor.h>
  7.  
  8. COLORSTRUCT msgcolors = {
  9.    foreback(BOLD+WHITE,RED),
  10.    foreback(BOLD+YELLOW,RED),
  11.    foreback(BLACK,WHITE),
  12.    foreback(BOLD+WHITE,WHITE)
  13. };
  14.  
  15. void main()
  16. {
  17.    /* initialize library */
  18.    initvideo();
  19.  
  20.    /* clear screen if user selects yes */
  21.    if(messagebox("Do you want the screen cleared?",
  22.       "Question",MB_YESNO,&msgcolors)) {
  23.  
  24.       vcolor(foreback(WHITE,BLACK));
  25.       cls();
  26.    }
  27. }
  28.